package drawer2.figure;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

import drawer2.figure.Ellipse;
import drawer2.figure.Rect;
import drawer2.figure.Square;

public class CanvasEditor implements ActionListener, MouseListener
{
	private JButton currentButton;
	private Figure currentFigure;
	public CanvasEditor(JButton initialSelectedButton)
	{
		this.currentButton = initialSelectedButton;
	}
	public void actionPerformed(ActionEvent e)
	{
		JButton currentButton = (JButton) e.getSource();

		if(currentButton.getText().equals("Ellipse"))
		{
			currentFigure = new Ellipse(0,0,60,40);
		}
		else if(currentButton.getText().equals("Rect"))
		{
			currentFigure = new Rect(0,0,60,40);
		}
		else
		{
			canvas.getGraphics().drawRect(x-25, y-25, 50,50);
		}
	}
	public void mousePressed(MouseEvent e){}
	public void mouseReleased(MouseEvent e){}
	public void mouseEntered(MouseEvent e){}
	public void mouseExited(MouseEvent e){}
}

